1. Field of the Invention
The present invention relates to a technique of obtaining the position and orientation of a target object.
2. Description of the Related Art
Along with recent development of robot technologies, robots are replacing humans to do complex tasks such as assembly of industrial products, which have been done by humans. A robot picks parts using an end effector such as a hand, and assembles them. Conventionally, parts to be picked are supplied using an apparatus called a parts feeder for supplying parts one by one in line, or supplied by heaping a plurality of parts in various orientations in a pallet (box). When the parts feeder is used, each part is supplied in a predetermined position and orientation, and the robot relatively easily picks it. However, it additionally costs to prepare the parts feeder. In some cases, different parts feeders need to be prepared in accordance with the shapes of parts. In contrast, heaping and supplying parts can avoid an increase in cost because parts are only placed in the pallet. Following a recent trend toward high-mix low-volume production, attention is being paid to heaped supply capable of quickly coping with various parts.
In a conventional technique disclosed in Japanese Patent No. 04226623 (to be referred to as patent literature 1 hereinafter), first, a camera installed above a pallet senses a plurality of target objects as a whole, and a two-dimensional position in the sensed image of them is obtained. Then, a sensor mounted on the hand portion of a robot is moved to a position near and above one target object. The sensor measures the position and orientation of the target object, and the robot hand grips the target object. The target object is measured in stages by a combination of the camera which senses the whole view and the sensor capable of detecting a position and orientation with high accuracy though the measurement range is narrow. If position and orientation measurement fails or gripping of a target object by the robot hand fails, this target object is excluded from the next detection targets, and the position and orientation measurement is executed again. The processing can be made efficient by excluding, from detection targets, a target object which is highly likely to be failed in measurement.
In the method disclosed in patent literature 1, if position and orientation measurement fails or gripping of a target object by the robot hand fails, this target object is excluded from the next detection targets, and the position and orientation measurement is executed again. At this time, position and orientation measurement failures are classified into two types. The first failure occurs when no target object can be detected and no position and orientation measurement result can be output. The second failure occurs when a position and orientation different from that of a target object is erroneously obtained and output as the measurement result. These two cases are regarded as failures in the sense that the position and orientation of a target object cannot be measured. However, patent literature 1 describes only the former failure, and does not mention the latter failure. Therefore, if the latter failure occurs in patent literature 1, it is not determined that the position and orientation measurement has failed, and the robot hand tries to grip a target object on the assumption that the target object exists in an erroneous position and orientation. In practice, the target object is placed in a position and orientation different from the measurement result, so the gripping by the robot hand fails. At this time, unnecessary processing including gripping and detection of a gripping failure occurs and decreases the efficiency.